home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / GameboyDev / GBDK / lib / global.s < prev    next >
Text File  |  1999-03-29  |  3KB  |  140 lines

  1.  
  2.     ;;  Screen dimensions 
  3.     .MAXCURSPOSX    = 0x13    ; In tiles
  4.     .MAXCURSPOSY    = 0x11
  5.  
  6.     .START        = 0x80
  7.     .SELECT        = 0x40
  8.     .B        = 0x20
  9.     .A        = 0x10
  10.     .DOWN        = 0x08
  11.     .UP        = 0x04
  12.     .LEFT        = 0x02
  13.     .RIGHT        = 0x01
  14.  
  15.     .SCREENWIDTH    = 0xA0
  16.     .SCREENHEIGHT    = 0x90
  17.     .MINWNDPOSX    = 0x07
  18.     .MINWNDPOSY    = 0x00
  19.     .MAXWNDPOSX    = 0xA6
  20.     .MAXWNDPOSY    = 0x8F
  21.  
  22.     .VBL_IFLAG    = 0x01
  23.     .LCD_IFLAG    = 0x02
  24.     .TIM_IFLAG    = 0x04
  25.     .SIO_IFLAG    = 0x08
  26.     .JOY_IFLAG    = 0x10
  27.  
  28.     .P1        = 0x00    ; Joystick: 1.1.P15.P14.P13.P12.P11.P10
  29.     .SB        = 0x01    ; Serial IO data buffer
  30.     .SC        = 0x02    ; Serial IO control register
  31.     .DIV        = 0x04    ; Divider register
  32.     .TIMA        = 0x05    ; Timer counter
  33.     .TMA        = 0x06    ; Timer modulo
  34.     .TAC        = 0x07    ; Timer control
  35.     .IF        = 0x0F    ; Interrupt flags: 0.0.0.JST.SIO.TIM.LCD.VBL
  36.     .NR10        = 0x10    ; Sound register
  37.     .NR11        = 0x11    ; Sound register
  38.     .NR12        = 0x12    ; Sound register
  39.     .NR13        = 0x13    ; Sound register
  40.     .NR14        = 0x14    ; Sound register
  41.     .NR21        = 0x16    ; Sound register
  42.     .NR22        = 0x17    ; Sound register
  43.     .NR23        = 0x18    ; Sound register
  44.     .NR24        = 0x19    ; Sound register
  45.     .NR30        = 0x1A    ; Sound register
  46.     .NR31        = 0x1B    ; Sound register
  47.     .NR32        = 0x1C    ; Sound register
  48.     .NR33        = 0x1D    ; Sound register
  49.     .NR34        = 0x1E    ; Sound register
  50.     .NR41        = 0x20    ; Sound register
  51.     .NR42        = 0x21    ; Sound register
  52.     .NR43        = 0x22    ; Sound register
  53.     .NR44        = 0x23    ; Sound register
  54.     .NR50        = 0x24    ; Sound register
  55.     .NR51        = 0x25    ; Sound register
  56.     .NR52        = 0x26    ; Sound register
  57.     .LCDC        = 0x40    ; LCD control
  58.     .STAT        = 0x41    ; LCD status
  59.     .SCY        = 0x42    ; Scroll Y
  60.     .SCX        = 0x43    ; Scroll X
  61.     .LY        = 0x44    ; LCDC Y-coordinate
  62.     .LYC        = 0x45    ; LY compare
  63.     .DMA        = 0x46    ; DMA transfer
  64.     .BGP        = 0x47    ; BG palette data
  65.     .OBP0        = 0x48    ; OBJ palette 0 data
  66.     .OBP1        = 0x49    ; OBJ palette 1 data
  67.     .WY        = 0x4A    ; Window Y coordinate
  68.     .WX        = 0x4B    ; Window X coordinate
  69.     .KEY1        = 0x4D    ; CPU speed
  70.     .VBK        = 0x4F    ; VRAM bank
  71.     .HDMA1        = 0x51    ; DMA control 1
  72.     .HDMA2        = 0x52    ; DMA control 2
  73.     .HDMA3        = 0x53    ; DMA control 3
  74.     .HDMA4        = 0x54    ; DMA control 4
  75.     .HDMA5        = 0x55    ; DMA control 5
  76.     .RP        = 0x56    ; IR port
  77.     .BCPS        = 0x68    ; BG color palette specification
  78.     .BCPD        = 0x69    ; BG color palette data
  79.     .OCPS        = 0x6A    ; OBJ color palette specification
  80.     .OCPD        = 0x6B    ; OBJ color palette data
  81.     .SVBK        = 0x70    ; WRAM bank
  82.     .IE        = 0xFF    ; Interrupt enable
  83.  
  84.     .G_MODE        = 0x01    ; Graphic mode
  85.     .T_MODE        = 0x02    ; Text mode (bit 2)
  86.     .T_MODE_OUT    = 0x02    ; Text mode output only
  87.     .T_MODE_INOUT    = 0x03    ; Text mode with input
  88.     .M_NO_SCROLL    = 0x04    ; Disables scrolling of the screen in text mode
  89.     .M_NO_INTERP    = 0x08    ; Disables special character interpretation
  90.  
  91.     
  92.     ;; Status codes for IO
  93.     .IO_IDLE    = 0x00
  94.     .IO_SENDING    = 0x01
  95.     .IO_RECEIVING    = 0x02
  96.     .IO_ERROR    = 0x04
  97.  
  98.     ;; Type of IO data
  99.     .DT_IDLE    = 0x66
  100.     .DT_RECEIVING    = 0x55
  101.  
  102.     ;; Table of routines for modes
  103.     .MODE_TABLE    = 0x01E0
  104.  
  105.     ;; Global variables
  106.     .globl    .mode
  107.  
  108.     .globl    __cpu
  109.  
  110.     .globl    __io_out
  111.     .globl    __io_in
  112.     .globl    __io_status
  113.  
  114.     ;; Global routines
  115.     .globl    .set_mode
  116.  
  117.     .globl    .reset
  118.  
  119.     .globl    .display_off
  120.  
  121.     .globl    .wait_vbl_done
  122.  
  123.     ;; Interrupt routines 
  124.     .globl    .add_VBL
  125.     .globl    .add_LCD
  126.     .globl    .add_TIM
  127.     .globl    .add_SIO
  128.     .globl    .add_JOY
  129.  
  130.     ;; Symbols defined at link time
  131.     .globl    .STACK
  132.     .globl    .OAM
  133.     .globl    .refresh_OAM
  134.  
  135.     ;; Initialization routine   
  136.     .globl    .init
  137.  
  138.     ;; Main user routine    
  139.     .globl    _main
  140.